<?php

namespace STAGE\StageBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * TypeStage
 *
 * @ORM\Table()
 * @ORM\Entity(repositoryClass="STAGE\StageBundle\Entity\TypeStageRepository")
 */
class TypeStage {

    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="type", type="string", length=255)
     */
    private $type;

    /**
     *
     * @ORM\OneToMany(targetEntity="STAGE\StageBundle\Entity\Stage",mappedBy="type")
     */
    private $stages;

    /**
     * Get id
     *
     * @return integer 
     */
    public function getId() {
        return $this->id;
    }

    /**
     * Set type
     *
     * @param string $type
     * @return TypeStage
     */
    public function setType($type) {
        $this->type = $type;

        return $this;
    }

    /**
     * Get type
     *
     * @return string 
     */
    public function getType() {
        return $this->type;
    }

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->stages = new \Doctrine\Common\Collections\ArrayCollection();
    }

    /**
     * Add stages
     *
     * @param \STAGE\StageBundle\Entity\Stage $stages
     * @return TypeStage
     */
    public function addStage(\STAGE\StageBundle\Entity\Stage $stages)
    {
        $this->stages[] = $stages;

        return $this;
    }

    /**
     * Remove stages
     *
     * @param \STAGE\StageBundle\Entity\Stage $stages
     */
    public function removeStage(\STAGE\StageBundle\Entity\Stage $stages)
    {
        $this->stages->removeElement($stages);
    }

    /**
     * Get stages
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getStages()
    {
        return $this->stages;
    }
    public function __toString() {
        return $this->type;
    }
}
